
#include "OffScreenRendererBase.h"

#include "FrameBufferObject.h"

#include <cassert>

using namespace Crystal::Shader;

OffScreenRendererBase::OffScreenRendererBase()
{
}

OffScreenRendererBase::~OffScreenRendererBase(void)
{
}

void OffScreenRendererBase::render()
{
	assert( GL_NO_ERROR == glGetError() );
	glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, frameBufferObject->getID() );
	glViewport( 0, 0, getWidth(), getHeight() );
	assert( GL_NO_ERROR == glGetError() );

	onRender();

	glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 );
}